{include file="common/business/header"}

<style>
    .loging_outerbox{
        background-color: #7d6ffa;
        padding: 70px 0 70px 0;
    }
.float-e-margins{
    background: url(__WWW_STATIC__/www/index/img/log-bc.png);
    height: 590px;
    background-position:center;
    background-repeat: no-repeat;
    background-color: transparent;
    overflow: hidden;
}
.form-horizontal{
    width: 1000px;
    margin:0 auto;
    margin-top: 120px;
    padding-left: 560px;
    box-sizing: border-box;
}
.log_list{
    width: 350px;
    height: 40px;
    position: relative;
    line-height: 40px;
    margin-bottom: 30px;
}
.log_list>input{
    background-color: #f9f9f9;
    border:none;
    width: 100%;
    text-indent: 50px;
    height: 40px;line-height: 40px;
}
.log_list>svg{
    position: absolute;
    left: 20px;
    top: 7px;
}
#loginBtn{
    height: 40px;
    width: 350px;
    cursor: pointer;
    line-height: 40px;
    text-align: center;
    font-size: 16px;
    color: #fff;
    background-color: #0790ef;
    border:none;
    border-radius: 3px;
    display: block;
    margin-bottom: 20px;
}
#cpt{
    box-sizing: border-box;
    border: 1px solid #dadada;
}
</style>

<div class="loging_outerbox">
    <div class="float-e-margins">
        <div>
            <form class="form-horizontal">
                    <h2 style="margin-bottom:25px;font-size:18px;text-align:center;width:350px;">商家登录</h2>
                    <div class="log_list">
                            <svg 
                            xmlns="http://www.w3.org/2000/svg"
                            xmlns:xlink="http://www.w3.org/1999/xlink"
                            width="16px" height="24px">
                           <image  x="0px" y="0px" width="16px" height="24px"  xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAYCAQAAABZqbWHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfhCBUUEwei31F2AAABIUlEQVQoz5WQvUoDURCFvzO7+TEhWmuj7+AriIhPYZ/WN/ABLBV8CkvBIvsAgqDY2FoEsYlKsgvZOxZulr2bWHiKCzPnm8uZUTbiilMSlsRKkCYaK7vjmD/k6EmZA898YS0z0LVDJ8WRn+khtgNGf1R8OkYAut6yxYC061B93AGPpocYoUcNVJFW9gCrB9I4NSRsYQRU9awN9KtYbAJANNNsANb1X8BRHW8DIKDAI8Ri2liyqNA1wKq3jBBbHcAaYMmCgPy3EvDRDlaS41MBKTkDu+SdBDD2MN4IRgjzPihXNmO7MTyl8H3VKzMzkoZ9y64O0huvl8aMYeP2ryA6j43OKOWeo7o8V1l+5xeN3V+U7ejaTzCWQI8hkDMHEsTExj8gbViZHi23AwAAAABJRU5ErkJggg==" />
                           </svg>
                        <input type="text" name="tel" placeholder="请输入手机号" class="form-control" autocomplete="off">
                    </div>
                    <div class="log_list">
                            <svg 
                            xmlns="http://www.w3.org/2000/svg"
                            xmlns:xlink="http://www.w3.org/1999/xlink"
                            width="16px" height="22px">
                           <image  x="0px" y="0px" width="16px" height="22px"  xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAWCAQAAABjo9T3AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfhCBUUExFWC+QnAAABQUlEQVQoz32OPS+kYRiFr3N7fCyrEJYVFLIRBc0moqE0FaVfoBHT0ewP2NZHv/9ge0I0jMS2JFpEppKdRMFIxnjf51bM4DWGq7ufc85zjo4AiNgAvzzHONcc+pZODAdANYNPse89goQAjhZsp2Ywx6GTXXr0l5/0M8ZvwXYcAYCWJYQv+6JOyXFNhRsd6BvTbuwBmBAsgNbFC39Ai+i5QkwIP/O66ngRGNKwEBaJHXQB989xoZQE+AoQDE9IgMfXBt3pB3hRGKGN6mN8UM1v9YpIEVytboQ46RsMAtuUaSeLxStfVaHkfaI5DqVA70cyCPqM8rtUlrK9OS+YZYbzN0OyWcvbcde/LyuxuUHEXEqVylz2WxVu6X4943dSK2X0u9Cw+3/jykZDntjwUkho4WNS84TPSEKYTzcZpZktcGlrT4zDbiYDYavQAAAAAElFTkSuQmCC" />
                           </svg>
                        <input type="password" placeholder="请输入登录密码" class="form-control" autocomplete="off">
                    </div>
                    <div class="log_list">
                            <svg 
                            xmlns="http://www.w3.org/2000/svg"
                            xmlns:xlink="http://www.w3.org/1999/xlink"
                            width="20px" height="24px">
                           <image  x="0px" y="0px" width="20px" height="24px"  xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAQAAABQQhX9AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfhCBUUEx7GtPm2AAABj0lEQVQoz42TPUiVYRTHf//z3tdLjUFNghS1hFCSS0tLDimNiQ5FtNgSDjU0RFsUtLjk0qRtiriFKC2XayQFfUFtUXHTzegDwvR9ntPgva8v97WrZ3rOc37P+Z8PHtVxHAAhIsBTvnMFDIDYjGx7LasyyhuGuEydi6gYUv24V7zKIU7QrwE/Woh91JLexs+sK+ival/oYW9bMdJ9YJAYf/YFbljnuOcn6wTZZDKxN/iTEW5wuJWz8h/B9zaYrGWv6VM5Y+ttJJ05cCqshVfq25l5DuoRZ1kARxM2ugWzsb+okkuHH9UVHwpT7nYzY+tWMqxCz6DaJ45tC3bN+XAEEjiZfWgr+7nJvVnD5qXwLJphymZK/WXmq4Vyz/tLKQ7E3hLYqFDj3I5vZ7IXOrjLcJe03B0a7UtTO7aubrNvulO8UxmDMd+wiN3XLJ3snuabX0EjPN6dcbitu4XN6HpylUYJe1e5oIdtK/Qn3msP+NXy49dkPD3NYl77MuA4IpDiR8I1xvx3OhmnbdPI8jX+A8gjgqu9YYRXAAAAAElFTkSuQmCC" />
                           </svg>
                            <input type="text" name="captcha" style="width:165px;float:left" placeholder="输入验证码" class="form-control" autocomplete="off">
                            <div id="captcha" style="float:right;width:175px">
                                <img id="cpt" src="{:url('index/captcha')}" width="120" height="40" >
                                <a href="javascript:void(0);" id="capt" style="float: right;">换一张</a>
                            </div>
                    </div>
                    <button id="loginBtn" class="" type="button">登  录</button>

                    <a href="{:url('index/forget')}" class="" type="button" style="float:left;font-size:16px;height:20px;">忘记密码</a>
                    <p style="float:left;width:175px;font-size:16px;margin-left:110px;"><a href="{:url('index/register')}" style="float:right">注册</a></p>
                
            </form>
        </div>
    </div>
</div>

<div id="suggest_browser" style="height: 100px; width: 100%; max-width: 1920px; min-width: 1200px; margin: 0px auto; background-size: 1920px 100px; background-position: center center; position: fixed; border: 1px solid rgb(204, 204, 204); background-color: white; bottom: 0px; z-index: 9999999; display: none;">
    <div style="width: 1000px; height: 100px; padding: 25px 0; margin: 0 auto;">
        <div style="width: 49px; height: 49px; background-size: 49px 49px; background-image: url(__WWW_STATIC__/img/browser.png); float: left;"></div>
        <div style="float: left; line-height: 50px; font-size: 20px; margin-left: 100px;">
            推荐使用谷歌浏览器浏览网页，其他浏览器可能会出现兼容问题。<a target="_blank" style="color: #428bca;" href="http://www.google.cn/intl/zh-CN/chrome/browser/">点我下载</a>
        </div>
        <a id="cancel_suggust">
            <div style="width: 22px; height: 22px; background-size: 22px 22px; background-image: url(__WWW_STATIC__/www/index/img/x.png); float: left; margin-left: 50px; margin-top: 10px; cursor: pointer;"></div>
        </a>
    </div>
</div>
{include file="common/business/footer" /}



<script src="__WWW_STATIC__/www/index/js/bootstrap.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.metisMenu.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.slimscroll.min.js"></script>

<script src="__WWW_STATIC__/www/index/js/momentjs.js"></script>

<!-- Flot -->
<script src="__WWW_STATIC__/www/index/js/jquery.flot.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.flot.tooltip.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.flot.resize.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.flot.pie.js"></script>

<!-- Data Tables -->
<script src="__WWW_STATIC__/www/index/js/jquery.dataTables.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/dataTables.bootstrap.js"></script>
<script src="__WWW_STATIC__/www/index/js/dataTables.responsive.js"></script>

<script src="__WWW_STATIC__/www/index/js/jquery.twbsPagination.min.js"></script>

<!-- Chosen -->
<script src="__WWW_STATIC__/www/index/js/select2.full.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/zh-CN.js"></script>
<!-- Data picker -->
<script src="__WWW_STATIC__/www/index/js/daterangepicker.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootstrap-datetimepicker.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootstrap-datetimepicker.zh-CN.js"></script>

<!-- Nestable List -->
<!-- <script src="__WWW_STATIC__/js/plugins/nestable/jquery.nestable.js"></script> -->

<!-- Custom and plugin javascript -->
<script src="__WWW_STATIC__/www/index/js/inspinia.js"></script>
<script src="__WWW_STATIC__/www/index/js/pace.min.js"></script>

<!-- ChartJS-->
<script src="__WWW_STATIC__/www/index/js/Chart.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/chartjs-demo.js"></script>

<script src="__WWW_STATIC__/www/index/js/icheck.min.js"></script>

<!-- <script src="__WWW_STATIC__/js/art-template.js"></script> -->
<script src="__WWW_STATIC__/www/index/js/jquery.md5.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootbox.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/notify.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/laravel-sms.js"></script>

<!-- <script src="__WWW_STATIC__/js/ZeroClipboard.min.js"></script> -->
<script src="__WWW_STATIC__/www/index/js/jquery.gridly.js"></script>

<script>
    $(".span:contains('首页')").css("color", "#4990E2").siblings().css("display", "block")
    var fakeId = new Date().getTime();

    function getFakeId() {
        fakeId++;
        return fakeId;
    }
</script>
<script>
    $("#loginBtn").on("click", doLogin);


    function doLogin() {

        var tel = $("input[name=tel]").val();
        // alert(tel);
        var pw = $("input[type='password']").val();
        var captcha = $("input[name='captcha']").val();
        if (tel == "") {
            $('#cpt').attr('src', "{:url('index/captcha', '', false)}/#" + Math.random());
            layer.msg("请输入手机号");
            return;
        }

        if (pw == "") {
            $('#cpt').attr('src', "{:url('index/captcha', '', false)}/#" + Math.random());
            layer.msg("请输入密码");
            return;
        }

        var url = "{:url('index/loginDo')}";
        $.post(url, {
            "tel": tel,
            "pw": pw,
            'captcha': captcha
        }, function (data) {
            if(data.status == 1) {
                var enterprise_id = data.data.enterprise_id;
                setTimeout(function(){
                    //layer.msg(data.msg);
					if(data.data.merchant_account_status == 1) {
                        window.location.href = "{:url('home/index')}";
						return true;
                    }
					if (data.data.enterprise_verify_status == 0) {
						window.location.href = "{:url('enterprise/create')}";
						return true;						
					} else if (data.data.enterprise_verify_status == 1) {
						if (data.data.store_verify_status == 0 ) {
							window.location.href = "{:url('store/create')}"; 
							return true;
						} else {
							window.location.href = "{:url('enterprise/confirm')}"; 
							return true;
						}
					} else if (data.data.enterprise_verify_status == 2) {
						if(data.data.store_verify_status == 2) {
							window.location.href = "{:url('index/active')}";
							return true;
						} else {
							window.location.href = "{:url('enterprise/confirm')}"; 
							return true;
						}
					}                   
                },1000);
            } else {
                $('#cpt').attr('src', "{:url('index/captcha', '', false)}/#"+Math.random());
                layer.msg(data.msg);
            }
        });
    }

    $('#capt').click(function () {
        $('#cpt').attr('src', "{:url('index/captcha', '', false)}/#" + Math.random());
    });

    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
        if (arr = document.cookie.match(reg))
            return unescape(arr[2]);
        else
            return null;
    }
    $(document).ready(function () {

        var arr = getCookie('phone');
        if (arr != null || arr != "") {
            $("input[name='tel']").val(arr);
        }

    });
</script>
</body>

</html>